<template>
	<view>
		<view v-for="(itme,index) in exceCardData" :key="index" class="contentBox">
			<view>
				<image :src="itme.map.mechanismEntity.mechanism_logo" style="width: 188rpx;height: 188rpx;border-radius: 12rpx;"></image>
			</view>
			<view style="margin-left: 20rpx;">
				<view class="leftCla" style="margin-top: 20rpx ;">
					<view style="color: #FF7501;font-size: 35rpx;">{{itme.map.masterSetPriceEntity.title}}</view>
					<view>{{itme.map.masterSetPriceEntity.course_num}}课时</view>
				</view>
				<view class="leftCla" style="margin-top: 75rpx ;">
					<view style="color: #666666;">
						<text>{{itme.map.mechanismEntity.contacts_title}}: </text>
						<text>{{itme.map.mechanismEntity.contact_telephone}}</text>
					</view>
					<view style="font-size: 20rpx;">{{itme.newTime}}</view>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				user_id: "",
				exceCardData: []
			}
		},
		
		onLoad() {
			try {
				this.user_id = uni.getStorageSync('userif_list').user_id
				this.getCardList()
			}catch(e){}
		},
		
		methods: {
			
			// 优学卡列表
			getCardList() {
				this.$myRequest({
					url: "/userCoupon/queryMyCoupon",
					data: {
						type: "voucher_redemption_12",
						user_id: this.user_id,
						pageSize: 10,
						currentPage: 1
					}
				}).then((res) => {
					if(res.code == 0) {
						if(res.data.length == 0) {
							uni.showToast({
								title: "暂无数据",
								icon: "none",
								duration: 2000
							})
						}else {
							res.data.forEach((itme) => {
								itme.newTime = itme.create_time.substring(0,7) + "  --  " + itme.overdue_time.substring(0,7)
								if(itme.map.masterSetPriceEntity != null) {
									this.exceCardData.push(itme)
								}
							})
						}
					}else {
						uni.showToast({
							title: "请求失败",
							icon: "none"
						})
					}
				})
			}
		}
	}
</script>
<style lang="scss" scoped>
	.contentBox {
		width: 690rpx;
		height: 200rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		margin: 20rpx 0 0 30rpx;
		box-sizing: border-box;
		padding: 6rpx;
		display: flex;
		.leftCla {
			font-size: 26rpx;
			width: 440rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
		}
	}
</style>